//
//  LCViewCell.m
//  B项目期
//
//  Created by lanou3g on 16/3/21.
//  Copyright © 2016年 LC. All rights reserved.
//

#import "LCViewCell.h"

@implementation LCViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {

        [self initLayUI];
    }
    
    return self;
}
-(void)initLayUI
{
    self.aimageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height - 50)];
    [self.contentView addSubview:self.aimageView];
    self.bImageView = [[UIImageView alloc]initWithFrame:CGRectMake(15, self.aimageView.frame.size.height + 173, 40, 40)];
    
    self.aButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.aButton.frame = CGRectMake(15, self.aimageView.frame.size.height + 173, 40, 40);
    [self.contentView addSubview:self.aButton];
    
    self.circle = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMinX(self.bImageView.frame) - 2, CGRectGetMinY(self.bImageView.frame) - 2 , CGRectGetWidth(self.bImageView.frame) + 4, CGRectGetHeight(self.bImageView.frame ) + 4)];
    self.circle.backgroundColor = [UIColor whiteColor];
    
    [self.aimageView addSubview:self.circle];
    [self.aimageView addSubview:self.bImageView]; // 加到ciecle之后,图片才能显现出来
    
    self.aLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, self.frame.size.width+20 , 50)];
//    self.aLabel.backgroundColor = [UIColor redColor];
    self.aLabel.textColor = [UIColor colorWithRed:255/255.0 green:250/255.0 blue:250/255.0 alpha:1];
    [self.aLabel setFont:[UIFont fontWithName:@"Helvetica-Bold" size:20]];
    self.aLabel.numberOfLines = 0;
    [self.aimageView addSubview:self.aLabel];
    
    self.bLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 50, 170, 30)];
    self.bLabel.textColor = [UIColor whiteColor];
    [self.aimageView addSubview:self.bLabel];
    
    self.cLabel = [[UILabel alloc]initWithFrame:CGRectMake(155, 50, 100, 30)];
    self.cLabel.textColor = [UIColor whiteColor];
    [self.aimageView addSubview:self.cLabel];

    // 切圆角
    self.aLabel.layer.cornerRadius = 4;
    self.aLabel.layer.masksToBounds = YES;
    self.bLabel.layer.cornerRadius = 4;
    self.bLabel.layer.masksToBounds = YES;
    self.cLabel.layer.cornerRadius = 4;
    self.cLabel.layer.masksToBounds = YES;
    self.bImageView.layer.cornerRadius = 5;
    self.bImageView.layer.masksToBounds = YES;
    self.circle.layer.cornerRadius = 5;
    self.circle.layer.masksToBounds = YES;
    self.aimageView.layer.cornerRadius = 4;
    self.aimageView.layer.masksToBounds = YES;
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.aimageView.frame = CGRectMake(5, -10, self.frame.size.width - 10,self.frame.size.height - 10);
    
}
@end
